/*
 *  $Id: AncientsSpring.cs 1067 2010-05-21 11:00:43Z thenn.erannor $
 *	This file is a part of Ragima CCG.
 *	(C) 2008 Ragima development group.
 *
 *	Licensed under the terms of the GNU GPL License version 2.
 *
 */

namespace Ragima.Cards001.Water.Lands {
    public class AncientsSpring: LandCard {
        public AncientsSpring(): base("001_w_l_ancients_spring") {
            Level = CompleteLevel.ReadyForTest;
            Element = ElementType.Water;
            Value = 100;
            AddManaCost(ElementType.Water, 2);
        }
        public override void SetNaturalAffects(ICollector<Affect> affects) {
            affects.Add(new Affects.ManaIncome(ElementType.Water, 2));
            affects.Add<AncientsSpringAura>();
        }

        private class AncientsSpringAura: CreatureAuraAffect {
            public AncientsSpringAura(): base(true, true) {}

            public override string Id {
                get { return AffectManager.GetCardId<AncientsSpring>("aura"); }
            }

            public override ElementType Element {
                get { return ElementType.Water; }
            }

            protected override bool AcceptCreature(Creature cr) {
                return cr.Card.GetSumMana() <= 3;
            }
            protected override Affect CreateSubAffect() {
                return new AncientsSpringSleeper();
            }
        }

        private class AncientsSpringSleeper: SpellAffect<AncientsSpring> {
            public AncientsSpringSleeper() {
                Add(new Affects.Sleeper());
            }
        }
    }
}
